package com.junzhiit.nengji.cms.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.junzhiit.nengji.bo.VipHistoryListBO;
import com.junzhiit.nengji.cms.service.VipHistoryService;
import com.junzhiit.nengji.cms.web.util.ViewObjectUtil;
import com.junzhiit.nengji.cms.web.vo.DataTablesParamVO;
import com.junzhiit.nengji.cms.web.vo.VipHistoryListVO;
import com.junzhiit.nengji.dao.VipHistoryDAO;

import cn.hutool.core.bean.BeanUtil;

@Service
public class VipHistoryServiceImpl extends BaseServiceImpl implements VipHistoryService {

	@Autowired
	private VipHistoryDAO vipHistoryDAO;
	
	@Override
	public Map<String,Object> queryVipHistory(DataTablesParamVO dtp, VipHistoryListVO vhlv) {
		VipHistoryListBO vhlb=new VipHistoryListBO();
		BeanUtil.copyProperties(vhlv, vhlb);
		List<VipHistoryListBO> vhlbList=vipHistoryDAO.query(vhlb, dtp.getStart(), dtp.getLength());
		Integer totalCount=vipHistoryDAO.getTotalCount(vhlb);
		return ViewObjectUtil.dataTables(vhlbList, dtp.getDraw(), totalCount);
	}

}
